package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import model.Model;
/*
 *  Course: S09-15437 - WEB APPLICATION DEVELOPMENT 
 * 	Name: Jiale Huang
 * 	Andrew ID: jialeh
 * 	Date: 2/23/2009
 *  Assignment: Hw4
 */

public class LogoutAction extends Action{

	public LogoutAction(Model model) { }
	
	@Override
	public String getName() {
		 return "logout.do";
	}

	@Override
	public String perform(HttpServletRequest request) {
        HttpSession session = request.getSession(false);
        session.setAttribute("user",null);

		request.setAttribute("message","You are now logged out");
        
		String webapp = request.getContextPath();
		return webapp + "/listBookmarks.do";
	}

}
